package com.pz.cloud.framework.student.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pz.cloud.framework.business.student.entity.Student;
import com.pz.cloud.framework.business.student.service.IStudentService;
import com.pz.cloud.framework.student.mapper.StudentMapper;
import org.springframework.stereotype.Service;

@Service
public class StudentServiceImpl extends ServiceImpl<StudentMapper, Student> implements IStudentService {
    @Override
    public Student getByStdNo(String stdNo) {
        LambdaQueryWrapper<Student> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper.eq(Student::getStdNo, stdNo);
        return getOne(queryWrapper);
    }

    @Override
    public Student getByUserId(String userId) {
        LambdaQueryWrapper<Student> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper.eq(Student::getUserId, userId);
        return getOne(queryWrapper);
    }

}
